<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>徐州物联网</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="../../res/layui/css/layui.css">
  <link rel="stylesheet" href="../../res/css/global.css">
  <link href="/portal/css/main.css" rel="stylesheet" />
  <link href="/portal/css/style.css" rel="stylesheet" />
  <script src="../../../js/jquery-1.8.3.min.js" type="text/javascript"></script>
</head>
<body>
<header>
  <div class="beijing">
    <h2><a href="index.html" ><em><font color="white">徐州市物联网及泛在技术研究中心</font></em></a></h2>
    <ul>
      <li>
        <a class="menu_1 hover"  href="/portal/index.html" >返回首页</a>
      </li>
    </ul>
    <div class="clear"></div>
  </div>
  <div class="clear"></div>
</header>


<div class="fly-panel fly-column" style="margin-top: 20px;">
  <div class="layui-container">
    <ul class="layui-clear">

      <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block">
        <a href="add.html" class="layui-btn">发表新帖</a>
      </li>
    </ul> 
  </div>
</div>

<div class="layui-container">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md8">
      <div class="fly-panel" style="margin-bottom: 0;">
        <ul class="fly-list">
        </ul>
      </div>
    </div>
    </div>
  </div>
</div>

<div class="fly-footer">
  <p></p>
  <p>
    <a href="http://fly.layui.com/jie/3147/" target="_blank"></a>
    <a href="http://www.layui.com/template/fly/" target="_blank"></a>
    <a href="http://fly.layui.com/jie/2461/" target="_blank"></a>
  </p>
</div>


<script type="text/javascript">
    $(function(){
        $.ajax({
            url:"/indexTalk",
            type:"post",
            dataType:"json",
            success:function(result){
                for(let i=0;i<result.length;i++){
                    let id=result[i].id;
                    let title=result[i].title;
                    let commNum=result[i].commentNum;
                    $(".fly-list").append(`
                      <li>
                          <input id="tid" type="text" name="id" value="${id}" hidden/>
                          <a href="user/home.html" class="fly-avatar">
                            <img src="../../res/images/dog.jpg"/>
                          </a>
                          <h2>
                          <a href="detail.html?id=${id}">${title}</a>
                          </h2>
                          <div class="fly-list-info">
                            回复：<span>${commNum}</span>条
                          </div>
                      </li>`);
                }
            }
        });
    });
</script>
</body>
</html>